

#ifndef PARSER_H_
#define PARSER_H_

#include <iostream>
#include <string>
#include "Token.h"
#include "List.h"
#include "Pipeline.h"
#include "Command.h"

using namespace std;

class Parser {
public:
	Parser(istream * is);
	virtual ~Parser();
	int parseRoot();
	void accept();
	void parseList();
	void parsePipeline();
	void parseRestPipeline();
	void parseSeperator();
	void parseRestPipes();
	void parseSimpleCommando();
	void parseWords();
	void printError();

private:
	List* currentlist;
	Pipeline* currentPipe;
	Command* currentCommand;

	Token* lookahead;
	istream * stream;
};

#endif /* PARSER_H_ */
